package com.umakr.ax.app.web;

import com.umakr.ax.common.service.FeedbackService;
import com.umakr.ax.core.base.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @author umakr
 */

@Controller
@RequestMapping("/api/web/feedback")
public class FeedbackWebController  extends AbstractController {

    @Autowired
    FeedbackService feedbackService;

    @GetMapping("/listFeedback")
    @ResponseBody
    public Object listFeedback(ModelMap modelMap, Integer type,
                               String startTime, String endTime,String systemName,
                               Integer confirmStatus,Integer solveStatus){
        return setSuccessModelMap(modelMap, feedbackService.listFeedback(type,startTime,endTime,systemName,
                confirmStatus,solveStatus));
    }

    @GetMapping("/updateFeedback")
    @ResponseBody
    public Object updateFeedback(ModelMap modelMap,Long id,Integer confirmStatus,Integer solveStatus,Integer delStatus){
        return setSuccessModelMap(modelMap,feedbackService.updateFeedback(id,confirmStatus,solveStatus,delStatus));
    }

    @GetMapping("/delectFeedback")
    @ResponseBody
    public Object delectFeedback(ModelMap modelMap,Long id){
        return setSuccessModelMap(modelMap,feedbackService.delectFeedback(id));
    }
}
